<section class="">
	<div class="row">
		<article class="col-sm-12 col-md-12">
			<div class="jarviswidget jarviswidget">
				<header>
					<span class="widget-icon"> <i class="fa fa-edit"></i>
					</span>
					<h2>用户编辑</h2>
				</header>

				<div>
					<div class="widget-body no-padding">
						<form name="userEditForm" class="smart-form"
							ng-submit="update(user)" novalidate>
							<header> 用户编辑 </header>

							<fieldset>
								<div class="row">
									<section class="col col-6">
										<label class="label col col-2">用户名 ：</label>
										<div class="col col-10">
											<p class="form-control-static">{{user.username}} </p>
										</div>
									</section>
									<section class="col col-6">
										<label class="label col col-2">密码 ：</label>
										<div class="col col-10">
											<a
												href="#/system/user-management/user/{{user.username}}/reset-password"
												class="btn btn-danger btn-xs field-btn"> 密码重置
											</a>
										</div>
									</section>
								</div>
								<div class="row">
									<section class="col col-6">
										<label class="label col col-2">姓名 ：</label>

										<div class="col col-10">
											<label class="input"
												ng-class="getValidationClass(userEditForm.fullname)">
												<i class="icon-append fa fa-male"></i> <input type="text"
												name="fullname" ng-model="user.fullname"
												placeholder="请填写用户名称" required>
											</label>
											<div class="error">
												<em class="invalid"
													ng-show="isValidatedOf(userEditForm.fullname, 'required')">
													姓名不能为空！ </em>
											</div>
										</div>
									</section>

									<section class="col col-6">
										<label class="label col col-2">邮箱 ：</label>

										<div class="col col-10">
											<label class="input"
												ng-class="getValidationClass(userEditForm.email)"> <i
												class="icon-append fa fa-envelope-o"></i> <input
												type="email" name="email" ng-model="user.email"
												placeholder="请填写有效的邮箱地址" required
												user-unique="{'name': 'email', 'exclusived' : originalemail}">
											</label>
											<div class="error">
												<em class="invalid"
													ng-show="isValidatedOf(userEditForm.email, 'required')">
													邮箱不能为空！ </em> <em class="invalid"
													ng-show="isValidatedOf(userEditForm.email, 'email')">
													请填写有效的邮箱地址! </em> <em class="invalid"
													ng-show="isValidatedOf(userEditForm.email, 'user-unique')">
													该邮箱已经注册 </em>
											</div>
										</div>
									</section>

								</div>
								<div class="row">

									<section class="col col-6">
										<label class="label col col-2">状态 ：</label>
										<div class="col-lg-8 inline-group">
											<label class="radio"> <input type="radio"
												name="enablement" ng-model="user.enablement" ng-value="true">
												<i></i>激活
											</label> <label class="radio"> <input type="radio"
												name="enablement" ng-model="user.enablement"
												ng-value="false"> <i></i>未激活
											</label>
										</div>
									</section>
									<section class="col col-6">
										<label class="label col col-2">管理员 ：</label>
										<div class="col-lg-8">
											<div class="inline-group">
												<label class="checkbox"> <input type="checkbox"
													ng-model="user.role" name="role" ng-true-value="ADMIN"
													ng-false-value="BASIC"> <i></i>
												</label>
											</div>
										</div>
									</section>
								</div>
							</fieldset>
							<footer>
								<button onclick="window.history.back();" class="btn btn-default"
									type="button">Back</button>
								
								<button type="button" ng-click="deleteUser(user.username)"
									ng-show="user.username" class="btn btn btn-danger btn-primary">删除</button>
								<button type="submit" ng-disabled="userEditForm.$invalid"
									class="btn btn-primary">保存</button>
							</footer>
						</form>


					</div>
				</div>
			</div>
		</article>
	</div>
</section>
